#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

int DigitSum(int n,int sum)
{
	sum += n % 10;

	if (n == 0)
	{
		return sum;
	}
	else
	{
		return DigitSum(n / 10, sum);
	}
}

int main()
{
	int n = 0;
	scanf("%d", &n);
	int sum = 0;
	printf("%d", DigitSum(n,sum));

	return 0;
}